<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            margin: 100px auto;
        }
        input{
            width: 300px;
            height: 30px;
            line-height: 5px;
            color: #999;
            outline: none;
            border: 0;
            border-bottom: 1px solid #ccc;
        }
    </style>
</head>
<body>
    <div>
        <input type="text" value="手机">
    </div>
    <script>
        var input = document.querySelector('input');
        input.onfocus = function(){
            if(this.value == '手机'){
                this.value = '';
            }
            this.style.color = '#333';
        }
        input.onblur = function(){
            if(this.value == ''){
                this.value = '手机';
            }
            this.style.color = '#999';
        }
    </script>
</body>
</html>